package java_1_26.exception;

public class Exception {
    public static void main(String[] args) {
        int[] arr={10,20,30};
        try{
            arr=null;
            System.out.println(arr[10]);
        }catch(ArrayIndexOutOfBoundsException e){//捕获相应异常
            System.out.println("数组下标越界");
        }catch(NullPointerException e){
            System.out.println("空指针异常");
        }
        System.out.println("异常后的代码");
    }
}
